# Contributor: Luca Weiss <luca@z3ntu.xyz>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=waybar
pkgver=0.10.3
pkgrel=0
pkgdesc="Highly customizable Wayland bar for Sway and Wlroots based compositors"
url="https://github.com/Alexays/Waybar/"
# s390x: no wireplumber (but who uses it there anyway)
arch="all !s390x"
license="MIT"
depends="tzdata"
makedepends="
	date-dev
	eudev-dev
	fmt-dev
	gtk-layer-shell-dev
	gtkmm3-dev
	jsoncpp-dev
	libdbusmenu-gtk3-dev
	libinput-dev
	libmpdclient-dev
	libnl3-dev
	meson
	playerctl-dev
	pulseaudio-dev
	scdoc
	spdlog-dev
	sndio-dev
	upower-dev
	wireplumber-dev
	"
subpackages="$pkgname-doc"
source="https://github.com/Alexays/Waybar/archive/$pkgver/Waybar-$pkgver.tar.gz
	config-fix-clock.patch
	"
options="!check" # No test suite
builddir="$srcdir/Waybar-$pkgver"

build() {
	# -Ddefault_library=shared - to override the project defaults.
	abuild-meson \
		-Ddefault_library=shared \
		-Ddbusmenu-gtk=enabled \
		-Dlibevdev=disabled \
		-Dlibnl=enabled \
		-Dlibudev=enabled \
		-Dman-pages=enabled \
		-Dmpd=enabled \
		-Dmpris=enabled \
		-Dpulseaudio=enabled \
		-Drfkill=enabled \
		-Dsndio=enabled \
		-Dsystemd=disabled \
		-Dwireplumber=enabled \
		-Dupower_glib=enabled \
		. output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
2e90007056b79bccad06902db2e8b6f25103bb7c86736cb0b7dc260795bc4a1b5db7a7b8a4bebe9169f0590585fd6b170193cf8aa5437d69bab0f78d66922084  Waybar-0.10.3.tar.gz
cd6fea7e9981e13ecb911da66b4f22e949542d4085d696e01d8d4eac0986e0ab15d5c1430040b76be730437a586dbe1f5c49ac8435269e6310fb2c213b6c74a2  config-fix-clock.patch
"
